<?php
/**
 * @package PHPRandom
 * @author Eric Guerin <1fizzle@gmail.com>
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 * @version 0.1
 *
 * Usage examples for the base random.php class
 */
 
require_once('random.php');

//instantiate the class, only need to do this once
$rand = new Random;

/**
 * Generate 10 random integers, each between 1 and 1,000,000, 
 * each having their own column (separated by a line break in the return.
 */
 
$rand->int_num = 10; //number of random integers to generate
$rand->int_min = 1; //minimum number to generate
$rand->int_max = 1000000; //maximum number to generate
$random_integer = $rand->randInteger();

echo "<pre>10 Random Integers, between 1 and 1,000,000: \n" . $random_integer . '</pre>';

/**
 * Generate a random sequence of numbers between 
 * 1 and 52 (e.g. a deck of cards)
 */
$rand->seq_min = 1;
$rand->seq_max = 52;
$random_sequence = $rand->randSequence();

echo "<pre>A random sequence of integers between 1 and 52: \n" . $random_sequence . '</pre>';

/**
 * Generate 5 random strings of characters,
 * each having 9 characters and allowing uppercase, 
 * lowercase, and digits, each being unique
 */
$rand->string_num = 5;
$rand->string_length = 9;
$rand->string_unique = 'on';
$random_string = $rand->randString();

echo "<pre>5 Random unique 9 character strings of uppercase, lowercase and numeric: \n" . $random_string . '</pre>';
?>